with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
function Generic_Array_Image
   (a : Element_Array_Type;
   show_index : Boolean := False
   ) return String
is
   result : Unbounded_String;
   require_delimiter : Boolean := False;
begin
   Append (result, "(");
   for i in a'Range loop
      if require_delimiter then
	 Append (result, ", ");
      else
	 require_delimiter := True;
      end if;
      if show_index then
	 Append (result, Index_Type'Image(i));
	 Append (result, " => ");
      end if;
      Append (result, Image (a(i)));
   end loop;
   Append (result, ")");
   return To_String(result);
end Generic_Array_Image;
